package com.leyou.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import javafx.beans.DefaultProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author jshstart
 * @creat 2020-12-22 13:05
 */
@Configuration
@EnableConfigurationProperties(SmsProperties.class)
public class SmsConfiguration {
    @Bean
    public IAcsClient iAcsClient(SmsProperties properties){
        DefaultProfile defaultProfile = DefaultProfile.getProfile(
                properties.getRegionID(), properties.getAccessKeyID(), properties.getAccessKeySecret()
        );
        return new DefaultAcsClient(defaultProfile);
    }
}
